<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body th:fragment="hasbei_top_user">

<div class="content-top" th:if="${auto!=''}">
    <div class="content-top-info">
        <div class="content-top-left">
            <div class="left-logo">
                <a href="/" class="logo-info" target="_self"><img src="/icon/logo.png" alt="有贝口腔网"></a>
            </div>
            <ul class="right-list">
                <li th:class="${zx == null?'':'right-list-active'}"><a href="/consult/main" target="_self"><img src="/icon/news-icon.png" alt="有贝口腔网"><span>资讯</span></a></li>
                <li th:class="${wd == null?'':'right-list-active'}"><a href="/answers/main" target="_self"><img src="/icon/qa-icon.png" alt="有贝口腔网"><span>问答</span></a></li>
            </ul>
        </div>
        <form action="/index/search" method="post">
            <div class="content-top-right">
                <div class="search-input">
                    <img class="search-icon" src="/icon/icon_Search.png">
                    <input class="top-search" type="text" name="kw" placeholder="请输入资讯、问题搜索" value="">
                    <input class="search-sub" type="submit" onclick="search(this)" value="搜索">
                </div>

                <div class="land-success">

                    <div class="message-notice">
                        <a href="/user/messages"><img src="/icon/notice.png" alt="有贝口腔网"><span class="notice-tip" id="msgCount" style="display:none">0</span></a>
                        <div class="notice-modul" id="myNoticeModul"><a href="/user/messages">站内消息<span class="tips-num">0</span></a></div>
                    </div>
                    <div class="land-success-img">
                        <a href="/user/main">
                            <img id="topuserImg" th:src="${user.imgpath}">
                            <span class="land-success-name" th:text="${user.name}">无言猪</span>
                        </a>
                        <div class="img-posi-div">
                            <a href="/user/main"><span>个人信息</span></a>
                            <a href="javascript:;" onclick="loginOut()"><span>退出登录</span></a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    function loginOut(){//退出登录

        $.post(basePath+"out",function(data){
            console.log(data)
            if(data=='ok'){
                layer.msg("退出成功");
                location.reload();
            }else{
                layer.msg("退出失败");
            }
        });
    }
</script>

</body>
</html>